<?php


namespace App\Kuafu\Holiday\Service;


use App\Kuafu\Base\Service\BaseService;
use App\Kuafu\Holiday\Enum\CodeEnum;
use App\Kuafu\Holiday\Model\LegalHolidayModel;
use Illuminate\Support\Facades\Cache;

class HolidayService extends BaseService
{
    /**
     * 获取节假日列表
     * @return mixed
     */
    public static function getHolidayConfigList()
    {
        $list = Cache::remember(CodeEnum::HOLIDAY_LIST_CACHE_KEY, 30, function (){
            return LegalHolidayModel::query()
                ->select(['holiday'])
                ->get();
        });
        return $list->toArray();
    }
}